package com.project.systemfront.service.impl;


import com.project.systemfront.mapper.CommentMapper;
import com.project.systemfront.pojo.Comment;
import com.project.systemfront.pojo.vo.CommentVo;
import com.project.systemfront.service.ICommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-20
 */
@Service
public class CommentServiceImpl implements ICommentService
{
    @Autowired
    private CommentMapper commentMapper;



    /**
     * 查询评论列表
     *
     * @param comment 评论
     * @return 评论
     */
    @Override
    public List<CommentVo> selectCommentList(Comment comment)
    {
        return commentMapper.selectCommentList(comment);
    }

    /**
     * 新增评论
     * 
     * @param comment 评论
     * @return 结果
     */
    @Override
    public int insertComment(Comment comment)
    {
        comment.setCreateTime(new Date());
        return commentMapper.insertComment(comment);
    }


}
